﻿<ViewDataFormTemplateSpec 
  xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
  xmlns:common="bb_appfx_commontypes"
  ID="ff2fb57c-38a9-493d-823f-f8095e994d7f" 
  Name="Designation Level Description View Form" 
  Description="Get Designation Level Id from Description" 
  Author="Blackbaud Professional Services" 
  DataFormInstanceID="ea22ce28-d383-46e9-a26f-2f19e6f6d605" 
  RecordType="Fundraising Purpose" 
  xmlns="bb_appfx_viewdataformtemplate"
  common:SecurityUIFolder="Service Bus Adapter" 
  >
  
  <SPDataForm SPName="USR_USP_DATAFORMTEMPLATE_VIEW_GET_DESIGNATION_LEVEL_ID_BY_DESC">
    <CreateProcedureSQL xmlns="bb_appfx_commontypes">

      create procedure dbo.USR_USP_DATAFORMTEMPLATE_VIEW_GET_DESIGNATION_LEVEL_ID_BY_DESC (
      @ID nvarchar(255),
      @DESIGNATIONLEVELID uniqueidentifier = null output,
      @DATALOADED bit = 0 output
      )
      as
      set nocount on;
      -- be sure to set this, in case the select returns no rows
      set @DATALOADED = 0;

      -- populate the output parameters, which correspond to fields on the form.  Note that
      -- we set @DATALOADED = 1 to indicate that the load was successful.  Otherwise, the system
      -- will display a "no data loaded" message.
      select TOP 1
      @DATALOADED = 1,
      @DESIGNATIONLEVELID  = ID
      from
      dbo.DESIGNATIONLEVELTYPE
      where
      DESCRIPTION = @ID

      
      return 0;

    </CreateProcedureSQL>
  </SPDataForm>
  <FormMetaData FixedDialog="true" xmlns="bb_appfx_commontypes">
    <FormFields>
      <FormField FieldID="DESIGNATIONLEVELID" DataType="Guid" Caption="" />
    </FormFields>
  </FormMetaData>
</ViewDataFormTemplateSpec>